import { createBrowserRouter,Navigate } from "react-router-dom";
import Home from "../pages/Home";
import Login from "../pages/Login";
import Layout from "../pages/Layout";
import User from "../pages/Mgmt/User";
import Role from "../pages/Mgmt/Role";
import Card from "../pages/Mgmt/Card";
import Charts from "../pages/Charts"
const routes=[
    {
      path: "/",
      Component: Login,
    },
    {
      path: "/login",
      Component: Login,
    },
    {
      path: "/home",
      Component: Layout,
      children:[
        {
          path: "/home",
          element: <Navigate to="/home/showcard" />
        },
        {
          path: "showcard",
          Component: Home
        },
      ]
    },
    {
      path:"/charts",
      Component:Layout,
      children: [
        {
          path:'/charts',
          Component:Charts
        }
      ]
    },
    {
      path: "/mgmt",
      Component: Layout,
      children:[
        {
          path: "/mgmt",
          element: <Navigate to="/mgmt/user" />
        },
        {
          path: "user",
          Component: User,
        },
        {
          path: "role",
          Component: Role,
        },
        {
          path: "card",
          Component: Card,
        }
      ]
    }
]
export default createBrowserRouter(routes);